package com.naiterui.ehp.bs.doctor.controller.inner;

import com.naiterui.ehp.bp.constants.SwaggerTag;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.doctor.exception.ExceptionCodes;
import com.naiterui.ehp.bs.doctor.utils.AdTencentCloudSdkUtil;
import com.naiterui.ehp.bs.wechat.service.IAccessTokenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luao
 * @date 2022/4/21 10:38 AM
 **/
@Api(tags = {SwaggerTag.DOCTOR + SwaggerTag.INNER_API + SwaggerTag.SELF_INSPECT})
@RestController
@RequestMapping("ad/inner/self/inspect")
@RequiredArgsConstructor
public class AdInnerSelfInspectController {

    private final IAccessTokenService accessTokenService;

    @ApiOperation(value = "腾讯云人脸核身自检")
    @GetMapping("/txFace")
    public void txFace() throws BusinessException {
        String accessToken = AdTencentCloudSdkUtil.accessToken();
        if (accessToken == null) {
            throw new BusinessException(ExceptionCodes.FAILED, "腾讯云人脸核身自检失败");
        }
    }
}
